<script setup lang="ts">
import useStore from './store';

const { user, counter } = useStore();
</script>

<template>
  <h1> 轻量状态管理库 Pinia </h1>
  <h2>{{ counter }}</h2>
  <h3>{{ counter.count }}</h3>
  <hr />
  <button @click="counter.add">同步修改添加</button>
  <button @click="counter.addSync(100)">异步添加</button>
  <hr />
  <h3>getters：{{ counter.double }}</h3>
</template>
